package chapter5;
import static utility.Print.*;

/*
 * Exercise 17: (2) Create a class with a constructor that takes a String argument. During
 * construction, print the argument. Create an array of object references to this class, but don’t
 * actually create objects to assign into the array. When you run the program, notice whether
 * the initialization messages from the constructor calls are printed.
 * 
 * Exercise 18: (1) Complete the previous exercise by creating objects to attach to the array
 * of references.
 */

class Class1 {
	public String s;

	public Class1(String s) {
		print("initializing: " + s);
	}
	
	public Class1() {
		s = "asd";
	}
}


public class Exercise17 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Class1 a[] = new Class1[10];
		
		for (int i = 0; i < 10; i++) {
			a[i] = new Class1();
		}
		print(a[0].s);
		
	}

}
